package pl.makimo.fuzzy.sets;

import java.util.HashMap;

import pl.makimo.fuzzy.sets.memberships.DiscreteMembershipFunction;

abstract public class Type2FuzzySet<T> extends FuzzySet<T> {
    public Object value(final T element) {
		Object e = this.realValue(element);
		Object val = membershipFunction.value(e);
		
		DiscreteFuzzySet<Double> emptySet = new DiscreteFuzzySet<Double>(new DiscreteMembershipFunction(new HashMap<Object, Object>() {{ put(element, 0.0); }}));
		emptySet.column = this.column;
		
		return val == null ? emptySet : val;
    }

}
